package xyz.wpxy.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import xyz.wpxy.entity.ResultCode;

/**
 * @Description 自定义异常类
 */
@Data
@AllArgsConstructor //全参构造方法
@NoArgsConstructor  //无参构造方法
public class ServiceException extends RuntimeException {

    //状态码:
    private Integer code;
    //错误信息:
    private String errorMsg;

    public ServiceException(String errorMsg) {
        this.code = ResultCode.getError();
        this.errorMsg = errorMsg;
    }
}
